home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SCLIB.ARJ / SCL1SAMP.EXE / DATE.C < prev    next >
C/C++ Source or Header  |  1992-01-01  |  795b  |  27 lines

  1. #include <scl1.h>
  2.  
  3. /*******************************
  4.     shows the GetDate function */
  5.  
  6. char *Day[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
  7.  
  8. char *Month[]={"","January","February","March","April","May","June",
  9.                "July","August","September","October","November","December"};
  10.  
  11. main()
  12. {
  13. struct DateData *p;
  14. p=GetDate();
  15.  
  16. /* p points to DateData structure:
  17.      p->WeekDay = day of the week (0=Sunday),
  18.      p->MonthDay = day (1-31),
  19.      p->Month = month (1-12)
  20.      p->Year = year (1980 - 2099).
  21. The month and day numbers reported by GetDate will be used as an
  22. index to the week and months names arrays we have previously
  23. defined.*/
  24.  
  25. printf("\n\nToday is %s, %s %d,%d",Day[p->WeekDay],Month[p->Month],p->MonthDay,p->Year);
  26. }
  27.